const routes = [
  {
    path: '/',
    redirect: '/index'
  },
  {
    path: '/index',
    name: '首页',
    component: () => import('@/views/index.vue'),
    children: [
      {
        path: '/useIntersectionObserver',
        name: '可视区域加载',
        component: () => import('@/views/demo/useIntersectionObserver/useIntersectionObserver.vue'),
      },
      {
        path: '/useWindowScroll',
        name: 'window滚动监听',
        component: () => import('@/views/demo/useWindowScroll/useWindowScroll.vue'),
      },      {
        path: '/useWindowSize',
        name: '窗口大小监听',
        component: () => import('@/views/demo/useWindowSize/useWindowSize.vue'),
      },      {
        path: '/useBroadcastChannel',
        name: '用于两个浏览器标签的通信',
        component: () => import('@/views/demo/useBroadcastChannel/useBroadcastChannel.vue'),
      },      {
        path: '/useClipboard',
        name: '剪贴板',
        component: () => import('@/views/demo/useClipboard/useClipboard.vue'),
      },      {
        path: '/useEventListener',
        name: '事件监听',
        component: () => import('@/views/demo/useEventListener/useEventListener.vue'),
      },      {
        path: '/useFullscreen',
        name: '一键全屏',
        component: () => import('@/views/demo/useFullscreen/useFullscreen.vue'),
      },      {
        path: '/useImage',
        name: 'loading图像',
        component: () => import('@/views/demo/useImage/useImage.vue'),
      },      {
        path: '/useScriptTag',
        name: '加载js脚本',
        component: () => import('@/views/demo/useScriptTag/useScriptTag.vue'),
      },      {
        path: '/useStyleTag',
        name: '修改style标签样式',
        component: () => import('@/views/demo/useStyleTag/useStyleTag.vue'),
      },      {
        path: '/useWebNotification',
        name: '网页端的消息提示',
        component: () => import('@/views/demo/useWebNotification/useWebNotification.vue'),
      },
      {
        path: '/useInfiniteScroll',
        name: '无限滚动',
        component: () => import('@/views/demo/useInfiniteScroll/useInfiniteScroll.vue'),
      },
      {
        path: '/useMagicKeys',
        name: '组合按键事件监听',
        component: () => import('@/views/demo/useMagicKeys/useMagicKeys.vue'),
      },
      {
        path: '/useVirtualList',
        name: '虚拟列表',
        component: () => import('@/views/demo/useVirtualList/useVirtualList.vue'),
      },
      {
        path: '/useDateFormat',
        name: '日期格式化',
        component: () => import('@/views/demo/useDateFormat/useDateFormat.vue'),
      },
      {
        path: '/useTimeAgo',
        name: '多长时间前',
        component: () => import('@/views/demo/useTimeAgo/useTimeAgo.vue'),
      },
      {
        path: '/useBase64',
        name: 'Base64转码',
        component: () => import('@/views/demo/useBase64/useBase64.vue'),
      },
      {
        path: '/useDebounceFn',
        name: '函数防抖',
        component: () => import('@/views/demo/useDebounceFn/useDebounceFn.vue'),
      },
      {
        path: '/useThrottleFn',
        name: '函数节流',
        component: () => import('@/views/demo/useThrottleFn/useThrottleFn.vue'),
      },
      {
        path: '/useScroll',
        name: '滚动监听',
        component: () => import('@/views/demo/useScroll/useScroll.vue'),
      }
    ]
  }
];
export default routes;
